package com.kaifamiao.time;

import java.time.LocalDate;
import java.time.LocalTime;

public class LocalTimeInstance {

    public static void main(String[] args) {

        LocalTime current = LocalTime.now();
        System.out.println( current );

        LocalTime time = LocalTime.of( 8, 0 );
        System.out.println( time );

        time = LocalTime.of( 17, 30, 50 );
        System.out.println( time );

        time = LocalTime.of( 18, 10, 30, 123456789 );
        System.out.println( time );

        // 根据秒数计算时间
        time = LocalTime.ofSecondOfDay( 60 * 60 * 15 / 2 );
        System.out.println( time );

        // 根据纳秒数计算时间
        time = LocalTime.ofNanoOfDay( 1000L * 1000L * 1000L * 60 * 60 * 15 / 2 );
        System.out.println( time );

        System.out.println( "- ".repeat( 10 ) );

        System.out.println( LocalTime.MIN );
        System.out.println( LocalTime.MAX );
        System.out.println( LocalTime.MIDNIGHT );
        System.out.println( LocalTime.NOON );

    }

}
